<script>
    jxt.textlist.newJson = function(dataJson, attrs) {
        if (!dataJson) dataJson = jxt.textlist.dataJson;
        var ret = [];
        var _self = jxt.tag.newJson(dataJson);
        _self.content = ['文字'];

        return _self;
    };
    jxt.textlist.editend = function(eleid, ele_textarea) {
        var t = $(ele_textarea).val();
        var list = [];
        var _list = t.split("\r");
        for (var i = 0; i < _list.length; i++) {
            var _t = $.trim(_list[i]);
            if (!_t) continue;
            var __list = _t.split("\n");
            for (var j = 0; j < __list.length; j++) {
                var __t = $.trim(__list[j]);
                if (!__t) continue;
                list.push(__t.trim());
            }

        }

        var node = jxt.getnode(eleid);
        node.content = list;
        jxt.msg.radio(eleid, "nodechange");
        jxt.render(eleid, true);
    };

    jxt.textlist.children = function() {
        return null;
    };
    jxt.textlist.add = function() {};

    jxt.textlist.create = function (subscribe_id, eventkey, attrs, event_source_id) {
        var node = jxt.textlist.newJson();
        if(attrs && attrs.tpname)
        {
            node.tpname=attrs.tpname;
        }
        jxt.msg.radio("textlist", "addmainnode", {"newnodelist": node});
        jxt.route.exe('textlist.editbegin',null,node.id);
    };
    jxt.msg.subscribe("textlist", "createtextlist", jxt.textlist.create);
</script>